﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Parentmasterpage.master" CodeBehind="Details.aspx.vb" Inherits="WebApplicationcruises.Details" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style14
        {
            width: 100%;
        }
        .style15
        {
            width: 172px;
            text-align: left;
            font-weight: bold;
        }
        .style16
        {
            text-align: left;
        }
    </style>
    <link href="CSS.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="style14">
        <tr>
            <td>
                &nbsp;&nbsp;</td>
        </tr>
        <tr>
            <td>
&nbsp;&nbsp;
                <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1" 
                    Width="703px" style="text-align: left">
                    <EditItemTemplate>
                        CTitle:
                        <asp:TextBox ID="CTitleTextBox" runat="server" Text='<%# Bind("CTitle") %>' />
                        <br />
                        CDate:
                        <asp:TextBox ID="CDateTextBox" runat="server" Text='<%# Bind("CDate") %>' />
                        <br />
                        CTime:
                        <asp:TextBox ID="CTimeTextBox" runat="server" Text='<%# Bind("CTime") %>' />
                        <br />
                        CSeason:
                        <asp:TextBox ID="CSeasonTextBox" runat="server" Text='<%# Bind("CSeason") %>' />
                        <br />
                        CCountry:
                        <asp:TextBox ID="CCountryTextBox" runat="server" 
                            Text='<%# Bind("CCountry") %>' />
                        <br />
                        CCity:
                        <asp:TextBox ID="CCityTextBox" runat="server" Text='<%# Bind("CCity") %>' />
                        <br />
                        CPlace:
                        <asp:TextBox ID="CPlaceTextBox" runat="server" Text='<%# Bind("CPlace") %>' />
                        <br />
                        CCoste:
                        <asp:TextBox ID="CCosteTextBox" runat="server" Text='<%# Bind("CCoste") %>' />
                        <br />
                        CDescription:
                        <asp:TextBox ID="CDescriptionTextBox" runat="server" 
                            Text='<%# Bind("CDescription") %>' />
                        <br />
                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Update" />
                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        CTitle:
                        <asp:TextBox ID="CTitleTextBox0" runat="server" Text='<%# Bind("CTitle") %>' />
                        <br />
                        CDate:
                        <asp:TextBox ID="CDateTextBox0" runat="server" Text='<%# Bind("CDate") %>' />
                        <br />
                        CTime:
                        <asp:TextBox ID="CTimeTextBox0" runat="server" Text='<%# Bind("CTime") %>' />
                        <br />
                        CSeason:
                        <asp:TextBox ID="CSeasonTextBox0" runat="server" 
                            Text='<%# Bind("CSeason") %>' />
                        <br />
                        CCountry:
                        <asp:TextBox ID="CCountryTextBox0" runat="server" 
                            Text='<%# Bind("CCountry") %>' />
                        <br />
                        CCity:
                        <asp:TextBox ID="CCityTextBox0" runat="server" Text='<%# Bind("CCity") %>' />
                        <br />
                        CPlace:
                        <asp:TextBox ID="CPlaceTextBox0" runat="server" Text='<%# Bind("CPlace") %>' />
                        <br />
                        CCoste:
                        <asp:TextBox ID="CCosteTextBox0" runat="server" Text='<%# Bind("CCoste") %>' />
                        <br />
                        CDescription:
                        <asp:TextBox ID="CDescriptionTextBox0" runat="server" 
                            Text='<%# Bind("CDescription") %>' />
                        <br />
                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                            CommandName="Insert" Text="Insert" />
                        &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <table class="style14">
                            <tr>
                                <td>
                                    I&#39;d like to name my cruise ..</td>
                                <td>
                                    <asp:Label ID="CTitleLabel" runat="server" Text='<%# Bind("CTitle") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    The date which the cruise will start in ..</td>
                                <td>
                                    <asp:Label ID="CDateLabel" runat="server" 
                                        Text='<%# Bind("CDate", "{0:d}") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    The time which the cruise will start in ..</td>
                                <td>
                                    <asp:Label ID="CTimeLabel" runat="server" 
                                        Text='<%# Bind("CTime", "{0:t}") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    The cruise will be in the season ..</td>
                                <td>
                                    <asp:Label ID="CSeasonLabel" runat="server" Text='<%# Bind("CSeason") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    The country which the cruise will start from ..</td>
                                <td>
                                    <asp:Label ID="CCountryLabel" runat="server" Text='<%# Bind("CCountry") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    The city which the cruise will start from ..</td>
                                <td>
                                    <asp:Label ID="CCityLabel" runat="server" Text='<%# Bind("CCity") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    The place I&#39;d like to visit in this cruise will be ..</td>
                                <td>
                                    <asp:Label ID="CPlaceLabel" runat="server" Text='<%# Bind("CPlace") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    I expect that the cruise will cost me approximately ..</td>
                                <td>
                                    <asp:Label ID="CCosteLabel" runat="server" Text='<%# Bind("CCoste") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    A brief description of the cruise ..</td>
                                <td>
                                    <asp:Label ID="CDescriptionLabel" runat="server" 
                                        Text='<%# Bind("CDescription") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Number of the visitors </td>
                                <td>
                                    <asp:Label ID="CDescriptionLabel0" runat="server" 
                                        Text='<%# Bind("AccountOfVistors") %>' />
                                </td>
                            </tr>
                        </table>
                        <br />

                    </ItemTemplate>
                </asp:FormView>
            </td>
        </tr>
        <tr>
            <td>
                <asp:DataList ID="DataList1" runat="server" DataKeyField="PId" 
                    DataSourceID="SqlDataSourcePicture">
                    <ItemTemplate>
                        <asp:Image ID="Image1" runat="server" Height="294px" 
                            ImageUrl='<%# Eval("PPath") %>' Width="712px" />
                        <br />
                    </ItemTemplate>
                </asp:DataList>
                <asp:SqlDataSource ID="SqlDataSourcePicture" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionStringDB %>" 
                    DeleteCommand="DELETE FROM [Pictures] WHERE [PId] = ?" 
                    InsertCommand="INSERT INTO [Pictures] ( [PPath], [CrusisesId]) VALUES ( ?, ?)" 
                    ProviderName="<%$ ConnectionStrings:ConnectionStringDB.ProviderName %>" 
                    SelectCommand="SELECT PId, PPath, CrusisesId FROM Pictures WHERE (CrusisesId = ?)" 
                    
                    UpdateCommand="UPDATE [Pictures] SET [PPath] = ?, [CrusisesId] = ? WHERE [PId] = ?">
                    <DeleteParameters>
                        <asp:Parameter Name="PId" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:SessionParameter Name="PPath" SessionField="fileupload" Type="String" />
                        <asp:SessionParameter Name="CrusisesId" SessionField="cid" Type="Int32" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:QueryStringParameter Name="?" QueryStringField="id" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="PPath" Type="String" />
                        <asp:Parameter Name="CrusisesId" Type="Int32" />
                        <asp:Parameter Name="PId" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td>
                <asp:SqlDataSource ID="SqlDataSourceVideo" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionStringDB %>" 
                    DeleteCommand="DELETE FROM [Videos] WHERE [VId] = ?" 
                    InsertCommand="INSERT INTO [Videos] ( [VPath], [CrusisesId]) VALUES (?, ?)" 
                    ProviderName="<%$ ConnectionStrings:ConnectionStringDB.ProviderName %>" 
                    SelectCommand="SELECT [VId], [VPath], [CrusisesId] FROM [Videos] WHERE ([CrusisesId] = ?)" 
                    
                    UpdateCommand="UPDATE [Videos] SET [VPath] = ?, [CrusisesId] = ? WHERE [VId] = ?">
                    <DeleteParameters>
                        <asp:Parameter Name="VId" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:SessionParameter Name="VPath" SessionField="fileupload" Type="String" />
                        <asp:SessionParameter Name="CrusisesId" SessionField="cid" Type="Int32" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:QueryStringParameter Name="CrusisesId" QueryStringField="id" 
                            Type="Int32" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="VPath" Type="String" />
                        <asp:Parameter Name="CrusisesId" Type="Int32" />
                        <asp:Parameter Name="VId" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>


                <asp:GridView ID="GridViewVideo" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="VId" DataSourceID="SqlDataSourceVideo" Width="699px">
                    <Columns>
                        <asp:HyperLinkField DataNavigateUrlFields="Vpath" 
                            DataNavigateUrlFormatString="ViewVideo.aspx?id={0}" Text="ViewVideo" 
                            DataTextField="Vpath" HeaderText="List of the Videoes" />
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <asp:DataList ID="DataList2" runat="server" DataKeyField="CommentId" 
                    DataSourceID="SqlDataSourceComments" Width="837px">
                    <HeaderTemplate>
                        <table class="style14">
                            <tr>
                                <td style="background-color: #589BB6">
                                    Comments</td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table class="style14">
                            <tr>
                                <td class="style15">
                                    UserName:</td>
                                <td class="style16">
                                    <asp:Label ID="UserName" runat="server" style="font-weight: 700" 
                                        Text='<%# Eval("Uname") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="style15">
                                    CommentTitle:
                                </td>
                                <td class="style16">
                                    <asp:Label ID="CommentTitleLabel" runat="server" style="font-weight: 700" 
                                        Text='<%# Eval("CommentTitle") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="style15">
                                    Comment:
                                </td>
                                <td class="style16">
                                    <asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="style15">
                                    Comment date: </td>
                                <td class="style16">
                                    <asp:Label ID="CommentLabel0" runat="server" 
                                        Text='<%# Eval("Commentdate", "{0:d}") %>' />
                                </td>
                            </tr>
                        </table>
<br />
                    </ItemTemplate>
                </asp:DataList>
            </td>
        </tr>
        <tr>
            <td>
                <asp:FormView ID="FormView2" runat="server" DataKeyNames="CommentId" 
                    DataSourceID="SqlDataSourceComments" DefaultMode="Insert" Width="847px">
                    <EditItemTemplate>
                        CommentId:
                        <asp:Label ID="CommentIdLabel1" runat="server" 
                            Text='<%# Eval("CommentId") %>' />
                        <br />
                        CommentTitle:
                        <asp:TextBox ID="CommentTitleTextBox" runat="server" 
                            Text='<%# Bind("CommentTitle") %>' />
                        <br />
                        Comment:
                        <asp:TextBox ID="CommentTextBox" runat="server" Text='<%# Bind("Comment") %>' />
                        <br />
                        Userid:
                        <asp:TextBox ID="UseridTextBox" runat="server" Text='<%# Bind("Userid") %>' />
                        <br />
                        CId:
                        <asp:TextBox ID="CIdTextBox" runat="server" Text='<%# Bind("CId") %>' />
                        <br />
                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Update" />
                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                    </EditItemTemplate>
                    <HeaderTemplate>
                        <table class="style14">
                            <tr>
                                <td style="background-color: #589BB6">
                                    Add Comment</td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </HeaderTemplate>
                    <InsertItemTemplate>
                        <table class="style14">
                            <tr>
                                <td>
                                    <b>CommentTitle: </b>
                                </td>
                                <td style="text-align: left">
                                    <asp:TextBox ID="CommentTitleTextBox" runat="server" 
                                        Text='<%# Bind("CommentTitle") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b>CommentTitle: </b>
                                </td>
                                <td style="text-align: left">
                                    <asp:TextBox ID="CommentTextBox" runat="server" Height="109px" 
                                        Text='<%# Bind("Comment") %>' TextMode="MultiLine" Width="438px" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b></b>
                                </td>
                                <td>
                                    <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                        CommandName="Insert" Text="Send" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b></b>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        CommentId:
                        <asp:Label ID="CommentIdLabel" runat="server" Text='<%# Eval("CommentId") %>' />
                        <br />
                        CommentTitle:
                        <asp:Label ID="CommentTitleLabel" runat="server" 
                            Text='<%# Bind("CommentTitle") %>' />
                        <br />
                        Comment:
                        <asp:Label ID="CommentLabel" runat="server" Text='<%# Bind("Comment") %>' />
                        <br />
                        Userid:
                        <asp:Label ID="UseridLabel" runat="server" Text='<%# Bind("Userid") %>' />
                        <br />
                        CId:
                        <asp:Label ID="CIdLabel" runat="server" Text='<%# Bind("CId") %>' />
                        <br />
                        <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                            CommandName="Edit" Text="Edit" />
                        &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                            CommandName="Delete" Text="Delete" />
                        &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                            CommandName="New" Text="New" />
                    </ItemTemplate>
                </asp:FormView>
                <asp:SqlDataSource ID="SqlDataSourceComments" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionStringDB %>" 
                    DeleteCommand="DELETE FROM [Comments] WHERE [CommentId] = ?" 
                    InsertCommand="INSERT INTO [Comments] ( [CommentTitle], [Comment], [Userid], [CId]) VALUES (?, ?, ?, ?)" 
                    ProviderName="<%$ ConnectionStrings:ConnectionStringDB.ProviderName %>" 
                    SelectCommand="SELECT Comments.CommentId, Comments.CommentTitle, Comments.Comment, Comments.Userid, Comments.CId, Users.Uname, Comments.Commentdate FROM (Comments INNER JOIN Users ON Comments.Userid = Users.UId) WHERE (Comments.CId = ?)" 
                    
                    
                    UpdateCommand="UPDATE [Comments] SET [CommentTitle] = ?, [Comment] = ?, [Userid] = ?, [CId] = ? WHERE [CommentId] = ?">
                    <DeleteParameters>
                        <asp:Parameter Name="CommentId" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="CommentTitle" Type="String" />
                        <asp:Parameter Name="Comment" Type="String" />
                        <asp:SessionParameter Name="Userid" SessionField="Userid" Type="Int32" />
                        <asp:SessionParameter Name="CId" SessionField="cid" Type="Int32" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:SessionParameter Name="?" SessionField="Cid" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="CommentTitle" Type="String" />
                        <asp:Parameter Name="Comment" Type="String" />
                        <asp:Parameter Name="Userid" Type="Int32" />
                        <asp:Parameter Name="CId" Type="Int32" />
                        <asp:Parameter Name="CommentId" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionStringDB %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionStringDB.ProviderName %>" 
        
        SelectCommand="SELECT CTitle, CDate, CTime, CSeason, CCountry, CCity, CPlace, CCoste, CDescription, AccountOfVistors FROM CruisesTable WHERE (CId = ?)" 
        
        
        UpdateCommand="UPDATE CruisesTable SET AccountOfVistors =AccountOfVistors  + 1 WHERE (CId = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="CId" QueryStringField="id" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:SessionParameter Name="?" SessionField="cid" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <br />
</asp:Content>
